package org.java.user.service;

import org.java.commons.vo.Result;
import org.java.user.api.damain.Role;
import org.java.user.api.damain.User;
import org.springframework.data.domain.Page;

import java.util.List;


public interface UserService {

    Result registry(User user);

    User loadUserByName(String name);

    User findById(String id);

    Result save(User user);

    Result changePassword(String id, String oldPassword, String newPassword, String confirmPassword);

    Result destroy(String id, String password);

    List<Role> findAllRoles();

    Result save(Role role);

    Result deleteRole(String id);

    Page<User> searchUser(String keyword, int pageNumber, int pageSize, String orderBy, String direction);
}
